<div class="tab_hot">
  <div class="tab_header">
    <ul>
      <li class="active"> <?php echo @$tab_1['title'];?> </li>
      <li> <?php echo @$tab_2['title'];?> </li>
    </ul>
  </div>
  <div class="content_tab" style="display:block"> 
    <?php 
    
    if(isset($post_t1) && $post_t1):
    $i=0;
    $total = count($post_t1);
    ?>
    <a href="<?php echo @$post_t1[$i]->url;?>" title="<?php echo @$post_t1[$i]->post_title;?>">
      <img width="300" src="<?php echo @$post_t1[$i]->image;?>" alt="<?php echo @$post_t1[$i]->alias;?>"></a>
    <p> 
      <a href="<?php echo @$post_t1[$i]->url;?>" title="<?php echo @$post_t1[$i]->post_title;?>"><?php echo $post_t1[$i]->post_title;?></a> </p>
    <ul>
      <?php $i++;for ($i; $i < $total ; $i++) :?>
      <li> 
        <a href="<?php echo @$post_t1[$i]->url;?>" title="<?php echo @$post_t1[$i]->post_title;?>">
          <?php echo $post_t1[$i]->post_title;?></a>
      </li>
      <?php endfor; ?>
    </ul>
    <?php endif;?>
  </div>
  
  <div class="content_tab" style="display:none"> 
    <?php 
    if(isset($post_t2) && $post_t2):
    $i=0;
    $total = count($post_t2);
    ?>
    <a href="<?php echo @$post_t2[$i]->url;?>" title="<?php echo @$post_t2[$i]->post_title;?>">
      <img width="300" src="<?php echo @$post_t2[$i]->image;?>" alt="<?php echo @$post_t2[$i]->alias;?>">
    </a>
    <p> 
      <a href="<?php echo @$post_t2[$i]->url;?>" title="<?php echo @$post_t2[$i]->post_title;?>"><?php echo $post_t2[$i]->post_title;?></a> 
    </p>
    <ul>
      <?php $i++;for ($i; $i < $total ; $i++) :?>
      <li> 
        <a href="<?php echo @$post_t2[$i]->url;?>" title="<?php echo @$post_t2[$i]->post_title;?>">
          <?php echo $post_t2[$i]->post_title;?></a>
      </li>
      <?php endfor; ?>
    </ul>
    <?php endif;?>
  </div>
  <script type="text/javascript">
	$(document).ready(function()
		{
		$('.tab_header ul li').click(function()
			{
        var _parent = $(this).closest('.tab_hot');
  			var index = $(this).index();
        _parent.find(".tab_header ul li").removeClass('active');
        $(this).addClass('active');
  			_parent.find( ".content_tab" ).css({'display':'none'});
  			_parent.find( ".content_tab" ).eq(index).css({'display':'block'});
			});
		});
</script> 
</div>